package com.tandashi.springbootstudy01.service.strategy.service;

import com.tandashi.springbootstudy01.service.strategy.dto.Order;

public abstract class BaseOrderProcessStrategy implements OrderProcessStrategy {

    @Override
    public void process(Order order) {
        //前置校验
        checkOrder(order);

        doProcess(order);

        //后置校验
        doLog(order);

    }

    protected abstract void doProcess(Order order);

    public void checkOrder(Order order){
        System.out.println("订单检查业务逻辑");
    }

    public void doLog(Order order){
        System.out.println("记录日志相关代码");
    }
}
